package com.dji.sample.manage.model.entity;



import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author yjt
 * @since 2022-09-09
 */
@TableName("device_play_line_info")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DevicePlayLineEntity implements Serializable {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
	@TableField("device_sn")
	private String deviceSn;

	@TableField("device_no")
	private String deviceNo;

	@TableField("start_time")
	private Long startTime;

	@TableField(exist = false)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date standerStartTime;

	@TableField("end_time")
	private Long endTime;

	@TableField(exist = false)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date standerEndTime;

	@TableField("create_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	@TableField("start_position")
	private String startPosition;

	@TableField("start_position_id")
	private Long startPositionId;

	@TableField("end_position")
	private String endPosition;

	@TableField("end_position_id")
	private Long endPositionId;

	private Integer flag;

	@TableField("device_type")
	private String deviceType;

	@TableField("org_id")
	private Long orgId;

	@TableField("org_code")
	private String orgCode;

	@TableField(exist = false)
	private String orgName;

	private String planIds;

	private String account;

	private String type;

	public DevicePlayLineEntity(String deviceSn) {
		this.deviceSn = deviceSn;
		this.createTime=new Date();
		this.startTime=System.currentTimeMillis();
	}



	@Override
	public String toString() {
		return "DevicePlayLineInfo{" +
			", id=" + id +
			", deviceSn=" + deviceSn +
			", startTime=" + startTime +
			", endTime=" + endTime +
			", createTime=" + createTime +
			", startPosition=" + startPosition +
			", endPosition=" + endPosition +
			"}";
	}
}
